﻿<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>店铺列表</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <div th:include="layout/resources :: resources"></div>
</head>
<body>
<div class="container-fluid">
    <div id="toolbar">
        <button onclick="add();">添加</button>
    </div>
    <table></table>
</div>

</body>
<script>

    $("table").framework().bootstrapTable({
        url: "/shop/getListByPage",
        columns: [{
            field: '',
            title: '序号',
            align: 'center',
            valign: 'middle',
            formatter: function (value, row, index) {
                return index + 1;
            }
        }, {
            field: 'logoUrl',
            title: 'Logo',
            align: 'center',
            valign: 'middle',
            formatter: function (value, row, index) {
                return '<img style="height: 50px;width:50px;" src="' + "/static" + value + '" />';
            }
        }, {
            field: 'shopName',
            title: '店名',
            align: 'center',
            valign: 'middle'
        }, {
            field: 'shopType',
            title: '店铺类型',
            align: 'center',
            valign: 'middle'
        }, {
            field: 'address',
            title: '地址',
            align: 'center',
            valign: 'middle'
        }, {
            field: 'createTime',
            title: '创建时间',
            align: 'center',
            valign: 'middle'
        }],
        responseHandler: function (res) {
            return {
                rows: res
            };
        }
    });

    function add() {
        framework.openWindow("/shop/toAdd", "80%", "80%", "添加店铺");
    }
</script>
</html>
